﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QWidget>
#include <QtWidgets>
#include "dtuwindow.h"
#include "injectorwindow.h"
#include "../model/injectortablemodel.h"

#include "../threads/sqlthread.h"


class MainWindow : public QWidget
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private:
    //  UI
    void setup_ui();
    //head container
    QGridLayout* setup_head();
    //tree container
    QGridLayout* setup_treeview();
    QTreeView* treeView;
    QStandardItemModel* setup_treemodel();

    //windows
    QStackedWidget* mainStackWidget;
    //DTU window
    DTUWindow* dtuWindow;
    //injector window
    InjectorWindow* injectorWindow;

    // THREADS
    SqlThread* sqlThread;
    TCPThread* tcpThread;

private slots:
    void slt_treeViewClick(const QModelIndex&);

};
#endif // MAINWINDOW_H
